<?php
namespace common\behaviors;

use Yii;
use yii\base\Behavior;
use yii\web\Controller;
use common\component\tool\MyCookie;

class P3p extends Behavior
{

    //让行为响应组件的事件触发
    public function events()
    {
        return [
            //控制器方法执行后触发事件
            // Controller::EVENT_AFTER_ACTION => 'begin',
        ];
    }

    public function begin()
    {
        echo 'begin';
    }

    public function setPageSize($pageSize)
    {
        $myCookie = new MyCookie;
        $myCookie->setCookie('pageSize', $pageSize);
    }

}
?>